import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
const Layout = () => import('@/layout/index.vue')

const routes: RouteRecordRaw[] = [{
  path: '/',
  component: Layout,
  children: [{
    name: 'Information',
    path: '/',
    component: () => import('@/views/information/index.vue')
  }, {
    name: 'Order',
    path: '/order',
    component: () => import('@/views/order/index.vue')
  }, {
    name: 'Wallet',
    path: '/wallet',
    component: () => import('@/views/wallet/index.vue')
  }, {
    name: 'Dynamic',
    path: '/dynamic',
    component: () => import('@/views/dynamic/index.vue')
  }, {
    name: 'Message',
    path: '/message',
    component: () => import('@/views/message/index.vue')
  }, {
    name: 'Store',
    path: '/store',
    component: () => import('@/views/store/index.vue')
  }, {
    name: 'Works',
    path: '/works',
    component: () => import('@/views/works/index.vue')
  }, {
    name: 'Advertising',
    path: '/advertising',
    component: () => import('@/views/advertising/index.vue')
  }, {
    name: 'Bill',
    path: '/bill',
    component: () => import('@/views/bill/index.vue')
  }, {
    name: 'Earnings',
    path: '/earnings',
    component: () => import('@/views/earnings/index.vue')
  }, {
    name: 'Invoice',
    path: '/invoice',
    component: () => import('@/views/invoice/index.vue')
  }, {
    name: 'Billing',
    path: '/billing',
    component: () => import('@/views/billing/index.vue')
  }]
}, {
  path: '/enter-personal',
  name: 'EnterPersonal',
  component: () => import('@/views/enter-personal/index.vue')
}, {
  path: '/enter-company',
  name: 'EnterCompany',
  component: () => import('@/views/enter-company/index.vue')
}, {
  path: '/info-company',
  name: 'InfoCompany',
  component: () => import('@/views/info-company/index.vue')
}, {
  path: '/info-personal',
  name: 'InfoPersonal',
  component: () => import('@/views/info-personal/index.vue')
}, {
  path: '/topup',
  name: 'Topup',
  component: () => import('@/views/topup/index.vue')
}, {
  path: '/store-home',
  name: 'StoreHome',
  component: () => import('@/views/store-home/index.vue')
}, {
  path: '/inactive',
  name: 'Inactive',
  component: () => import('@/views/inactive/index.vue')
}, {
  path: '/information',
  redirect: '/'
}]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
